package com.dingding.transfer.stamper.constant;

/**
 * @author wangxiyuan
 * @description 定义cache名称、超时时长秒、最大个数 每个cache缺省3600秒过期，最大个数1000
 * @createDate 2021/3/30 16:00
 **/
public enum Caches {
    DINGDING_TOKEN_EXPIRE(7000),
    STAMPER_TOKEN_EXPIRE(1800),
    DEVICE_MAPPER(Integer.MAX_VALUE),
    TEMPLETE_INFO(Integer.MAX_VALUE),
    COMP_INFO(1800),
    USER_INFO(Integer.MAX_VALUE);
    //最大數量
    private int maxSize = 1000;

    //过期时间（秒）
    private int ttl = 3600;

    Caches() {
    }

    Caches(int ttl) {
        this.ttl = ttl;
    }

    Caches(int ttl, int maxSize) {
        this.ttl = ttl;
        this.maxSize = maxSize;
    }

    public int getMaxSize() {
        return maxSize;
    }

    public void setMaxSize(int maxSize) {
        this.maxSize = maxSize;
    }

    public int getTtl() {
        return ttl;
    }

    public void setTtl(int ttl) {
        this.ttl = ttl;
    }
}
